package com.hjf.booking.module.record.mapper;

import com.hjf.booking.module.record.VO.ConsumeRecordReport;
import com.hjf.booking.module.record.po.ConsumeRecord;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import tk.mybatis.mapper.common.BaseMapper;

import java.math.BigDecimal;
import java.sql.JDBCType;
import java.util.Date;
import java.util.List;

/**
 * @author hjf
 * @date 2021-02-22 9:53
 */
public interface ConsumeRecordMapper extends BaseMapper<ConsumeRecord> {

    BigDecimal dayReport(@Param("dayStart") Date dayStart, @Param("dayEnd") Date dayEnd);

    BigDecimal monthReport(@Param("mothStart") Date mothStart, @Param("monthEnd") Date monthEnd);

    BigDecimal yearReport(@Param("yearStart") Date yearStart, @Param("yearEnd") Date yearEnd);

    @Select("<script>" +
            " select sum(amount) from consume_record where consume_date &lt; #{dayEnd}" +
            "</script>")
    BigDecimal totalReport(@Param("dayEnd") Date dayEnd);
}
